<template>
    <div class="record">
        <div class="recordhead">
            <van-icon name="arrow-left" @click="()=>{this.$router.go(-1)}"/>
            <p>看房记录</p>
            <span></span>
        </div>
        <div class="main">
            <dl v-for="v in roomRecord" :key="v.houseCode">
                <dt><img :src="'http://47.102.145.189:8009' + v.houseImg" alt=""></dt>
                <dd>
                    <p>{{v.title}}</p>
                    <p>{{v.desc}}</p>
                    <p><span v-for="(item, index) in v.tags" :key="index">{{item}}</span>
                    </p>
                    <p class="price">{{ v.price }} 元/月</p>
                </dd>
            </dl>
        </div>
    </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  computed: {
    ...mapState(['roomRecord'])
  }
}
</script>

<style scoped lang='scss'>
.record{
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.recordhead{
    width: 100%;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    background: #21b97a;
    color: #fff;
    p{
        font-size: 18px;
    }
}
.main{
    width: 100%;
    flex: 1;
    overflow-y: scroll;
    dl {
        width: 100%;
        display: flex;
        padding: 5px 10px;
        border-bottom: 1px solid gray;
        dt {
            width: 110px;
            height: 100%;
            margin-right: 15px;
            img {
                width: 100%;
                height: 100%;
            }
        }
        dd {
            display: flex;
            flex-direction: column;
            :nth-child(1) {
                font-weight: bold;
                font-size: 14px;
                margin: 4px 0px;
            }
            :nth-child(2) {
                font-size: 12px;
                margin: 4px 0px;
            }
            :nth-child(3) {
                margin: 4px 0px;
                span {
                font-size: 12px;
                display: inline-block;
                background: rgb(229, 244, 237);
                color: rgb(103, 190, 144);
                padding: 2px;
                border-radius: 19px;
                }
            }
            :nth-child(4) {
                font-size: 14px;
                margin: 4px 0px;
            }
        }
    }
}
</style>
